<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>
<%@ page import="java.util.*" %>

<%@ page  import="org.apache.struts.util.RequestUtils" %>
<%//@ page  import="org.apache.struts.Globals" %>
<%@ page import="org.apache.struts.action.Action"%>
<%@ page import="com.erp.app.common.select.beans.SelectDelegate"%>
<%@ page import="com.erp.framework.util.CommonUtil"%>
<%@ page import="com.erp.app.catalog.catgroup.vo.*" %>
<%@ page import="com.erp.app.catalog.catgroup.dao.*" %>
<%@ page import="com.erp.app.catalog.catgroup.pk.CatalogGroupPK" %>

<jsp:useBean id="catalogLoginForm" scope="session" type="com.erp.app.catalog.login.web.CatalogLoginForm" />

    <link rel="stylesheet" href="<html:rewrite page="/stylesheet/style.css" />" type="text/css">
    <link rel="stylesheet" href="<html:rewrite page="/stylesheet/style1.css" />" type="text/css">
<%
	ArrayList rslt =  catalogLoginForm.getCateMenuList();
    pageContext.setAttribute("menuItemList", rslt);
    
%>
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="<html:rewrite page="/javascript/LayerCover.js" />"></SCRIPT>
    <style>
    a:link {  text-decoration: none; }
    a:visited {  text-decoration: none; }
    a:hover { text-decoration: none; }
    .main_menu {  font-family: "Tahoma","Arial", "San Serif", "Helvetica";
    			  font-size: 12px; font-weight: bold; padding-left:20px;
    			  background-image: url(images/img_dotted_line.gif);
    			  background-repeat: repeat-x;
				  background-position: bottom;
				  background-color:#EDF3FE;}
    .subMenu {  font-family: "Tahoma","Arial", "San Serif", "Helvetica";
    			font-size: 11px; font-weight: bold; padding-left:35px;
    			background-image: url(images/img_dotted_line.gif);
    			background-repeat: repeat-x;
				background-position: bottom;
				background-color:#EDF3FE;}
    .subMenu2 {  font-family: "Tahoma","Arial", "San Serif", "Helvetica"; 
    			 font-size: 11px; padding-left:50px;
    			 background-image: url(images/img_dotted_line.gif);
    			 background-repeat: repeat-x;
				 background-position: bottom;
				 padding-bottom: 5px;
				 padding-top: 5px;
				 background-color:#EDF3FE;}
    </style>


  </head>
<script language="JavaScript" >
var lastCellId="";

function menuMouseClick1(tagName){
	var tags = document.getElementsByName(tagName);
	if (tags[0].style.display == 'none'){
		tags[0].style.display = '';
	}else{
		tags[0].style.display = 'none';
	}
	for(var i=0;i<tags.length;i++){
		tags[i].style.display = tags[0].style.display;
	}
}
function menuMouseClick2(tagName1,tagName2){
	var tags1 = document.getElementsByName(tagName1);
	var tags2 = document.getElementsByName(tagName2);

}

function menuMouseOverOut(cellObj, evenType){
	if(lastCellId != cellObj.id){
		if(evenType=="over"){
      cellObj.style.backgroundColor="#627EB7";
		}else{
			cellObj.style.backgroundColor="";
		}
	}
}

function menuMouseClick(menuObjId, linkLocation){
  var menuType = menuObjId.substring(4,5);
  var menuIdLen = menuObjId.length;
  var menu1 = menuObjId.substring(5,7);
  var menu2 = "";
  var menu3 = ""
  if(menuIdLen>7){menu2 = menuObjId.substring(7,9);}
	if(menuIdLen>9){menu3 = menuObjId.substring(9,11);}
	if(menuType=="1"){
		var menuObj = document.getElementById(menuObjId);
		if(lastCellId!=""){
			var lastCell = document.getElementById(lastCellId)
			if(lastCell)lastCell.style.backgroundColor="";
		}
		if(menuObj)menuObj.style.backgroundColor="#FFFFFF";
		lastCellId=menuObjId;
		parent.frames.mainFrame.location=linkLocation;
	}else{
	  var tdTagList=document.getElementsByTagName("td");
		for(i=0; i<tdTagList.length; i++){
			if( tdTagList[i].name == "Menu"){
				var idLen = tdTagList[i].id.length;
				if(menuIdLen==7){
					if( tdTagList[i].id.substring(5,7)==menu1){
						if(idLen==9){
							if(tdTagList[i].parentNode.style.display=="none"){
								tdTagList[i].parentNode.style.display="block";
							}else{
								tdTagList[i].parentNode.style.display="none";
							}
						}else if(idLen==11){
							tdTagList[i].parentNode.style.display="none";
						}
					}
				}else if(menuIdLen==9){
					if( tdTagList[i].id.substring(5,9)==menu1+menu2){
						if(idLen==9){
							tdTagList[i].parentNode.style.display="block";
						}else if(idLen==11){
							if(tdTagList[i].parentNode.style.display=="none"){
								tdTagList[i].parentNode.style.display="block";
							}else{
								tdTagList[i].parentNode.style.display="none";
							}
						}
					}
				}
			}
	  }
	}
}

function menuShow(menuObjId){
	if(lastCellId!=""){
		var lastCell = document.getElementById(lastCellId)
		if(lastCell)lastCell.style.backgroundColor="";
	}
  var tdTagList=document.getElementsByTagName("td");
	if(menuObjId == null || menuObjId==""){
		for(i=0; i<tdTagList.length; i++){
			if( tdTagList[i].name == "Menu"){
				var idLen = tdTagList[i].id.length;
				if(idLen>7){tdTagList[i].parentNode.style.display="none";}
			}
		}
	}else{
		var menuType = menuObjId.substring(4,5);
		var menuIdLen = menuObjId.length;
		var menu1 = menuObjId.substring(5,7);
		var menu2 = "";
		var menu3 = ""
		if(menuIdLen>7){menu2 = menuObjId.substring(7,9);}
		if(menuIdLen>9){menu3 = menuObjId.substring(9,11);}
		if(menuIdLen==7){
			for(i=0; i<tdTagList.length; i++){
				if( tdTagList[i].name == "Menu"){
					var idLen = tdTagList[i].id.length;
					if(idLen==9 && tdTagList[i].id.substring(5,7)==menu1){
						tdTagList[i].parentNode.style.display="block";
					}else if(idLen>7){
						tdTagList[i].parentNode.style.display="none";
					}
				}
			}
		}else if(menuIdLen==9){
			for(i=0; i<tdTagList.length; i++){
				if( tdTagList[i].name == "Menu"){
					var idLen = tdTagList[i].id.length;
					if(idLen==9 && tdTagList[i].id.substring(5,7)==menu1){
						tdTagList[i].parentNode.style.display="block";
						if(menuType=="1" && tdTagList[i].id.substring(5,9)==menu1+menu2){
							tdTagList[i].style.backgroundColor="#FFFFFF";
							lastCellId=tdTagList[i].id;
						}
					}else if(idLen==11 && tdTagList[i].id.substring(5,9)==menu1+menu2){
						tdTagList[i].parentNode.style.display="block";
					}else if(idLen>7){
						tdTagList[i].parentNode.style.display="none";
					}
				}
			}
		}else if(menuIdLen==11){
			for(i=0; i<tdTagList.length; i++){
				if( tdTagList[i].name == "Menu"){
					var idLen = tdTagList[i].id.length;
					if(idLen==9 && tdTagList[i].id.substring(5,7)==menu1){
						tdTagList[i].parentNode.style.display="block";
					}else if(idLen==11 && tdTagList[i].id.substring(5,9)==menu1+menu2){
						tdTagList[i].parentNode.style.display="block";
						if(menuType=="1" && tdTagList[i].id.substring(5,11)==menu1+menu2+menu3){
							tdTagList[i].style.backgroundColor="#FFFFFF";
							lastCellId=tdTagList[i].id;
						}
					}else if(idLen>7){
						tdTagList[i].parentNode.style.display="none";
					}
				}
			}
		}
	}
}

</script>

        <table width="183" border="0" cellspacing="0" cellpadding="0" height="100%" bgcolor="#EDF3FE">
          <tr>
            <td align valign="top">
              <table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                <tr>
                  <td height="22" valign="bottom" background="<html:rewrite page="/images/location_bg.gif" />" class="t1">
					<logic:present  name="menuItemList">
						<chtml:catalogMenu menuItemCollection="menuItemList" realPath="<%=request.getContextPath()%>"/>
					</logic:present>  
                  </td>
                </tr>
              </table>
			  
            </td>
          </tr>
        </table>
